//
// ********************************************************************
// * License and Disclaimer                                           *
// *                                                                  *
// * The  Geant4 software  is  copyright of the Copyright Holders  of *
// * the Geant4 Collaboration.  It is provided  under  the terms  and *
// * conditions of the Geant4 Software License,  included in the file *
// * LICENSE and available at  http://cern.ch/geant4/license .  These *
// * include a list of copyright holders.                             *
// *                                                                  *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work  make  any representation or  warranty, express or implied, *
// * regarding  this  software system or assume any liability for its *
// * use.  Please see the license in the file  LICENSE  and URL above *
// * for the full disclaimer and the limitation of liability.         *
// *                                                                  *
// * This  code  implementation is the result of  the  scientific and *
// * technical work of the GEANT4 collaboration.                      *
// * By using,  copying,  modifying or  distributing the software (or *
// * any work based  on the software)  you  agree  to acknowledge its *
// * use  in  resulting  scientific  publications,  and indicate your *
// * acceptance of all terms of the Geant4 Software license.          *
// ********************************************************************
//
//
/// \file B1/include/SteppingAction.hh
/// \brief Definition of the B1::SteppingAction class

/*
Geant4的一次模拟称为一个"Run". 在一个"Run"中, 粒子源会分批次产生若干个粒子, 每一批称为一个"Event".
    在"Event"中, 每个粒子或者是次级粒子在材料中行进的轨迹, 被称为"Track".
        在一条"Track"上有若干个相互作用点, 在Geant4中被称为"Step", 每一个Step代表着粒子与材料发生了一次相互作用.
            "Step"是Geant4中用于控制/总结每个粒子的相互作用点模拟的一个类,
            一般在此类中指定 相互作用点模拟 的 初始化/开始/结束 的所有操作, 以及记录每个 相互作用点模拟的结果.
*/

#ifndef B1SteppingAction_h
#    define B1SteppingAction_h 1
#    include "G4UserSteppingAction.hh"  //一般用户自定义的SteppingAction类继承于此

class G4LogicalVolume;
class G4Step;

namespace B1
{

    class EventAction;  // 前向声明

    /// Stepping action class

    class SteppingAction : public G4UserSteppingAction
    {
    public:
        SteppingAction(EventAction* eventAction);  // 连接 upper level
        ~SteppingAction() override = default;

        /// method from the base class
        ///在该成员函数中指定每一个Step中的操作
        void UserSteppingAction(const G4Step*) override;

    private:
        EventAction* _fEventAction = nullptr;  /// ptr of upper struct
        G4LogicalVolume* _fScoringVolume = nullptr;
    };

}  // namespace B1

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

#endif
